 
import i18n from '@/locales/index'
const { t } = i18n.global
export const baseUrl = {
  // 产品信息
  baseColor: {
    add: '/api/basic/color/save',
    edit: '/api/basic/color/edit'
  },
  baseSize: {
    add: '/api/basic/size/save',
    edit: '/api/basic/size/edit'
  },
  productParts: {
    add: '/api/basic/product-part/save',
    edit: '/api/basic/product-part/edit'
  },
  productType: {
    add: '/api/basic/product-type/save', 
    edit: '/api/basic/product-type/edit',
  },
  processLibrary: {
    add: '/api/basic/basic-process/save',
    edit: '/api/basic/basic-process/edit',
  },
  // 工艺信息
  section: {
    add: '/api/basic/section/save',
    edit: '/api/basic/section/edit',
  },
  processDefect: {
    add: '/api/basic/defect/save',
    edit: '/api/basic/defect/edit'
  },
  processStarving: {
    add: '/api/basic/lack-material/save',
    edit: '/api/basic/lack-material/edit'
  },
  styleProcessLibrary: {
    add: '/api/basic/style-process/save',
    edit: '/api/basic/style-process/edit'
  },
  // 订单信息
  clientManage: {
    add: '/api/basic/custom/save',
    edit: '/api/basic/custom/edit'
  },
  // 人员信息
  workPro: {
    add: '/api/basic/profession/add',
    edit: '/api/basic/profession/edit'
  },
   // 技能等级
   skillLevel: {
    add: '/api/basic/skill-grade/add',
    edit: '/api/basic/skill-grade/edit'
  },
  employeesGroup: {
    add: '/api/basic/staff-group/save',
    edit: '/api/basic/staff-group/edit'
  },
  machineType: {
    add: '/api/device/device-model/save',
    edit: '/api/device/device-model/update'
  }
}
/*
  
  标签名称，必需
  label: '项目名称',
  输入区域placeholder，必需
  placeholder: '请输入项目名称',
  对应字段，必需
  column: 'code',
  规则  rules: [],
  输入类型，input：输入框、select：普通下拉框、date：日期、datetime：时间...
  type: 必填
*/
export const baseModelItem = {
  // 产品信息
  baseColor: [
    {
      label: 'basicData.colorCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      // rules: [{ required: true, message: 'basicData.colorCode') }]
    },
    {
      label: 'basicData.colorName',
      placeholder: 'basicData.pleaseInputColorName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputColorName') }],
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea'
    }
  ],
  baseSize: [
    {
      label: 'basicData.sizeCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      // rules: [{ required: true, message: 'basicData.sizeCode') }]
    },
    {
      label: 'basicData.sizeName',
      placeholder: 'basicData.pleaseInputSizeName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputSizeName') }],
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea'
    }
  ],
  productParts: [
    {
      label: 'basicData.positionCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      // rules: [{ required: true, message: '部位编码' }]
    },
    {
      label: 'basicData.positionName',
      placeholder: 'basicData.pleaseInputPositionName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputPositionName') }],
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea'
    }
  ],
  productType: [
    {
      label: 'basicData.typeCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      // rules: [{ required: true, message: '类型编码' }]
    },
    {
      label: 'basicData.typeName',
      placeholder: 'basicData.pleaseInputTypeName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputTypeName') }],
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea'
    }
  ],
  processLibrary: [
    {
      label: 'basicData.processCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
      // rules: [{ required: true, message: 'basicData.processCode') }]
    },
    {
      label: 'basicData.section',
      placeholder: 'common.pleaseSelect',
      column: 'section',
      rules: [{ required: true, message: t('basicData.pleaseSelectSection') }],
      type: 'select',
      isName: true,
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.sortNo',
      placeholder: 'common.pleaseInput',
      column: 'sortField',
      type: 'input',
      rules: [{ required: true, message: t('basicData.pleaseInputSortNo') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processNo',
      placeholder: 'common.pleaseInput',
      column: 'processNo',
      type: 'inputNumber',
      minNo: 0,
      rules: [
        { required: true, message: 'basicData.pleaseInputProcessNo' },
        { pattern: /^[0-9][0-9]*$/, message: t('other.intOnly'), trigger: 'change' }
      ],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processCodes',
      placeholder: 'common.pleaseInput',
      column: 'processCode',
      type: 'input',
      rules: [{ required: true, message: t('basicData.pleaseInputProcessCodes') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processNames',
      placeholder: 'common.pleaseInput',
      column: 'name',
      type: 'input',
      rules: [{ required: true, message: t('basicData.pleaseInputProcessName') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ], 
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.standardTimeSec',
      placeholder: 'common.pleaseInput',
      column: 'standardSeconds',
      type: 'inputNumber',
      rules: [{ pattern: /^\d{1,5}(\.\d{1,8})?$/, message: t('components.ruleFiveEightNumber') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.priceYuan',
      placeholder: 'common.pleaseInput',
      column: 'labourCost',
      type: 'inputNumber',
      rules: [{ pattern: /^\d{1,5}(\.\d{1,8})?$/, message: t('components.ruleFiveEightNumber') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea',
      cloSapn: 16,
      labelCol: { span: 23 },
      wrapperCol: {span: 23 }
    }
  ],
  // 工艺信息
  section: [
    {
      label: 'basicData.sectionCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true
    },
    {
      label: 'basicData.sectionCodes',
      placeholder: 'basicData.pleaseInputSectionCodes',
      column: 'sectionCode',
      type: 'input'
    },
    {
      label: 'basicData.sectionName',
      placeholder: 'basicData.pleaseInputSectionName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputSectionName') }],
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState')}],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    }
  ],
  processDefect: [
    {
      label: 'basicData.blemishCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true
    },
    {
      label: 'basicData.sortNo',
      placeholder: 'basicData.pleaseInputSortNo',
      column: 'sort',
      rules: [{ required: true, message: t('basicData.pleaseInputSortNo')}],
      type: 'inputNumber',
      // type: 'input',
      min: 0
    },
    {
      label: 'basicData.blemishName',
      placeholder: 'basicData.pleaseInputBlemishName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputBlemishName') }],
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea'
    }
  ],
  processStarving: [
    {
      label: 'basicData.materialsCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.materialsName',
      placeholder: 'basicData.pleaseInputMaterialsName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputMaterialsName') }],
      type: 'input',
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState')}],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea',
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    }
  ],
  styleProcessLibrary: [
    {
      label: 'basicData.style',
      placeholder: '',
      column: 'styleId',
      type: 'select',
      disabled: true,
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.section',
      placeholder: 'common.pleaseSelect',
      column: 'section',
      rules: [{ required: true, message: t('basicData.pleaseSelectSection') }],
      type: 'select',
      isName: true,
      needTrans: false,
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.sortNo',
      placeholder: 'common.pleaseInput',
      column: 'sortField',
      type: 'input',
      rules: [{ required: true, message: t('basicData.pleaseInputSortNo') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processNo',
      placeholder: 'common.pleaseInput',
      column: 'processNo',
      type: 'inputNumber',
      minNo: 0,
      rules: [
        { required: true, message: t('basicData.pleaseInputProcessNo')},
        { pattern: /^[0-9][0-9]*$/, message: t('other.intOnly'), trigger: 'change' }
      ],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processCodes',
      placeholder: 'common.pleaseInput',
      column: 'processCode',
      type: 'input',
      rules: [{ required: true, message: t('basicData.pleaseInputProcessCodes') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.processNames',
      placeholder: 'common.pleaseInput',
      column: 'name',
      type: 'input',
      rules: [{ required: true, message: t('basicData.pleaseInputProcessName') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.standardTimeSec',
      placeholder: 'common.pleaseInput',
      column: 'standardSeconds',
      type: 'inputNumber',
      rules: [{ pattern: /^\d{1,5}(\.\d{1,8})?$/, message: t('components.ruleFiveEightNumber') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'basicData.priceYuan',
      placeholder: 'common.pleaseInput',
      column: 'labourCost',
      type: 'inputNumber',
      rules: [{ pattern: /^\d{1,5}(\.\d{1,8})?$/, message: t('components.ruleFiveEightNumber') }],
      labelCol: { span: 22 },
      wrapperCol: { span: 22 }
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      rules: [],
      type: 'textarea',
      cloSapn: 16,
      labelCol: { span: 23 },
      wrapperCol: {span: 23 }
    }
  ],
  // 订单信息
  clientManage: [
    {
      label: 'basicData.customerCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
      // rules: [{ required: true, message: 'basicData.colorCode') }]
    },
    {
      label: 'basicData.customerName',
      placeholder: 'basicData.pleaseInputCustomerName',
      column: 'name',
      rules: [{ required: true, message: t('basicData.pleaseInputCustomerName') }],
      type: 'input'
    },
    {
      label: 'basicData.connectPerson',
      placeholder: 'basicData.pleaseInputConnectPerson',
      column: 'contactPerson',
      type: 'input'
    },
    {
      label: 'basicData.connectPhone',
      placeholder: 'basicData.pleaseInputConnectPhone',
      column: 'contactPhone',
      type: 'input'
    },
    {
      label: 'basicData.address',
      placeholder: 'basicData.pleaseInputAddress',
      column: 'address',
      type: 'input'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      type: 'textarea'
    }
  ],
  // 人员信息
  workPro: [
    {
      label: 'basicData.workNo',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
    },
    {
      label: 'basicData.workName',
      placeholder: 'basicData.pleaseInputWorkName',
      column: 'name',
      rules: [
        { required: true, message: t('basicData.pleaseInputWorkName') },
        { max: 9, message: t('components.ruleNotMoreNineNumber') }
      ],
      type: 'input'
    },
    {
      label: 'basicData.workCodes',
      placeholder: 'basicData.pleaseInputWorkCodes',
      column: 'number',
      type: 'input',
      rules: [
        { required: true,message: t('basicData.pleaseInputWorkCodes') },
        {  max: 9, message: t('components.ruleNotMoreNineNumber') }
      ],
    },
    {
      label: 'basicData.machineConnect',
      placeholder: 'basicData.pleaseSelectMachineConnect',
      column: 'modelId',
      type: 'select'
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      type: 'textarea',
      rules: [
        {  max: 99, message: t('components.ruleNotMoreNinetyNineNumber') }
      ]
    }
  ],
  // 技能等级
  skillLevel: [
    {
      label: 'basicData.lvNo',
      placeholder: 'common.systemAutoGenerate',
      column: 'code',
      type: 'input',
      disabled: true,
    },
    {
      label: 'basicData.lvName',
      placeholder: 'basicData.pleaseInputLvName',
      column: 'grade',
      rules: [
        { required: true, message: t('basicData.pleaseInputLvName') },
        { whitespace: true, message: t('basicData.pleaseInputLvName') },
        { max: 9, message: t('components.ruleNotMoreNineNumber') },
        
      ],
      type: 'input'
    },
    {
      label: 'basicData.lvCodes',
      placeholder: 'basicData.pleaseInputLvCodes',
      column: 'number',
      type: 'input',
      rules: [
        { required: true, message: t('basicData.pleaseInputLvCodes') },
        { whitespace: true, message: t('basicData.pleaseInputLvName') },
        {  max: 9, message: t('components.ruleNotMoreNineNumber') }
      ],
    },
    {
      label: 'basicData.priority',
      placeholder: 'basicData.pleaseInputPriority',
      column: 'priority',
      type: 'inputNumber',
      rules: [
        { required: true, message: t('basicData.pleaseInputPriority') },
        { pattern: /^\d{0,9}$/, message: t('components.ruleNineNumber'), trigger: 'change' }
      ],
      minNo: 1
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    },
    {
      label: 'common.remark',
      placeholder: 'common.pleaseInput',
      column: 'remark',
      type: 'textarea',
      rules: [
        {  max: 99, message: t('components.ruleNotMoreNinetyNineNumber') }
      ]
    }
  ],
  // 员工组别
  employeesGroup: [
    {
      label: 'components.groupName',
      placeholder: 'components.pleaseInputGroupName',
      column: 'name',
      type: 'input',
      rules: [
        { required: true, message: t('components.pleaseInputGroupName') },
        { whitespace: true, message: t('components.pleaseInputGroupName') },
        {  max: 9, message: t('components.ruleNotMoreNineNumber') }
      ],
    },
  ],
  // 机种管理
  machineType: [
    {
      label: 'basicData.machineCode',
      placeholder: 'common.systemAutoGenerate',
      column: 'number',
      type: 'input',
      disabled: true,
    },
    {
      label: 'basicData.machineName',
      placeholder: 'basicData.pleaseInputMachineName',
      column: 'name',
      rules: [
        { required: true, message: t('basicData.pleaseInputMachineName') },
        { whitespace: true, message: t('basicData.pleaseInputMachineName') },
        { max: 19, message: t('components.ruleNotMoreNineteenNumber') },
        
      ],
      type: 'input'
    },
    {
      label: 'basicData.machineCodes',
      placeholder: 'basicData.pleaseInputMachineCodes',
      column: 'code',
      type: 'input',
      rules: [
        { required: true, message: t('basicData.pleaseInputMachineCodes') },
        { whitespace: true, message: t('basicData.pleaseInputMachineName') },
        {  max: 19, message: t('components.ruleNotMoreNineteenNumber') }
      ],
    },
    {
      label: 'common.startState',
      placeholder: 'common.pleaseSelectStartState',
      column: 'status',
      rules: [{ required: true, message: t('common.pleaseSelectStartState') }],
      type: 'radio',
      optionsList: [
        {value: 0, label: 'common.start'},
        {value: 1, label: 'common.stop'},
      ]
    }
  ]
}